home *** CD-ROM | disk | FTP | other *** search
-
- ;program outfix.asm
- ;replaces int 3 (breakpoint instruction) with 'out dx,ax' handler
-
- cseg segment
- assume cs:cseg
- org 100h
-
- start proc near
- jmp makeres ;make handler resident
-
- int_3: ;this routine gets called when int 3 generated
- cli ;disable interrupts
- out dx,al ;out the low byte to (dx)
- xchg al,ah
- inc dx
- out dx,al ;out the high byte to (dx+1)
- xchg al,ah ;put the registers back in order
- dec dx
- sti ;enable interrupts
- iret ;return to caller
- end_int_3:
-
- makeres:
- push cs ; get cs into ds
- pop ds
- assume ds:cseg
- mov ax,2503h ;ah=25 -> DOS set vector function, al=3 ->int 3 vecter
- mov dx,offset int_3 ;dx=vector to be loaded into vector table
- int 21h ;call DOS service
- mov dx,offset end_int_3 ;get size of handler in bytes
- mov cl,4
- shr dx,cl
- inc dx ;convert to paragraphs
- mov ax,3100h ;ah= ->DOS keep process function
- int 21h ;call DOS service
-
- start endp
- cseg ends
- end start